<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    //return view('welcome');
    echo "the first mvc";
});

Route::get('/test', function () {
    //return view('welcome');
    echo "test";
});

Route::get('/admin/user', function () {
    //return view('welcome');
    echo "admin/user";
});

//post路由
Route::post('/insert', function () {
    //return view('welcome');
    echo "insert";
});

//加载表单模板
Route::get('/form', function () {
    return view('/form');
    
});
//put请求

Route::get('/put', function () {
    return view('put');
    
});
Route::put('/update', function () {
    echo "这个是update";
    
});

//带参数的路由请求
Route::get('/article/{id}', function ($id) {
    echo "这个是传递id";
    
});
//传递多个参数
Route::get('/{type}-{id}',function($type,$id){
    echo "当前为$type-$id";
});
Route::get('/test','TestController@index');

//Route::controller('rous','RouController');//www.public.com/rou/show
Route::controller('rous','RouController',[
    'getKing'=>'rou.King',
    ]);


